#include "UiAutoLogoWnd.h"

UiAutoLogoWnd::UiAutoLogoWnd()
{
}

UiAutoLogoWnd::~UiAutoLogoWnd()
{
}

BOOL UiAutoLogoWnd::InitUiWin(void)
{
	BOOL bRtn = FALSE;
	LoadiInterItem();
	return bRtn;
}

void UiAutoLogoWnd::PaintWin(HDC hdc, RECT* prcWin, RECT* prcUpdate)
{
	m_AutoLogoWndBG->Draw(hdc, prcWin, false, false);
}

int UiAutoLogoWnd::OnLButtonDown(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonDown(fwKeys, xPos, yPos);

}

int UiAutoLogoWnd::OnLButtonUp(UINT fwKeys, int xPos, int yPos)
{
	return UiWin::OnLButtonUp(fwKeys, xPos, yPos);

}

void UiAutoLogoWnd::LoadiInterItem()
{
//jdhuang 20120818
	
	m_AutoLogoWndBG = ImagingHelper::GetImageObject(MzGetInstanceHandle(), 1066);
	RECT rtBtnAutoLogoWnd[MAX_AUTO_LOGO_WND_BTN] = 
	{
		470, 271, 586, 332, 
		620, 271, 736, 332, 
	};
	
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetPos(rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].left, rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].top,
					rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].right-rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].left,
					rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].bottom-rtBtnAutoLogoWnd[AUTO_LOGO_WND_ON].top);
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetID(6300);
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1004, true));
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1005, true));
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetText(L"ON");
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON].SetTextColor(RGB(255, 255, 255));
	AddChild(&m_BtnAutoLogoWnd[AUTO_LOGO_WND_ON]);

	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetPos(rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].left, rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].top,
					rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].right-rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].left,
					rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].bottom-rtBtnAutoLogoWnd[AUTO_LOGO_WND_OFF].top);
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetID(6301);
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetNormalImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1004, true));
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetPressedImage(ImagingHelper::GetImageObject(MzGetInstanceHandle(),1005, true));
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetText(L"OFF");
	m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF].SetTextColor(RGB(255, 255, 255));
	AddChild(&m_BtnAutoLogoWnd[AUTO_LOGO_WND_OFF]);

}

BOOL UiAutoLogoWnd::InitImages()
{
	return TRUE;
}
void UiAutoLogoWnd::DeleteImages()
{
	m_AutoLogoWndBG->UnloadImage();
}